[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
##############################################################################
###+---------+################################################################
#+-| INKEY() |-------------------------------+################################
#| +---------+ Reads a key from the keyboard |################################
#|             and returns its numeric value |################################
#+-------------------------------------------+################################
##############################################################################
##############################################################################
#+--| Summary |------------+##################################################
#|     #INCLUDE io.hdr     |##################################################
#+-------------------------+##################################################
##############################################################################
##############################################################################
#+--| Syntax |---------------------------+####################################
#|     FUNCTION UINT inkey PROTOTYPE     |####################################
#+---------------------------------------+####################################
##############################################################################
##############################################################################
##########+---| Description |--------------------------------------+##########
##########| The inkey() function reads a key from the keyboard and |##########
##########| returns its numeric value.  If a key is not available, |##########
##########| then zero is returned.  If a key is avilable, it is    |##########
##########| removed from the keyboard buffer and returned to the   |##########
##########| caller.                                                |##########
##########| ------------------------------------------------------ |##########
##########| Key values are defined in the keys.hdr header file.    |##########
##########+--------------------------------------------------------+##########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| *    Display a message until a key is pressed.           |#########
#########|                                                          |#########
#########| PROCEDURE waitme                                         |#########
#########|                                                          |#########
#########|     ? "I'M JUST WAITING ON A KEY..."                     |#########
#########|     DO WHILE inkey() = 0                                 |#########
#########|     ENDDO                                                |#########
#########|     ? "JUST GOT A KEY."                                  |#########
#########|                                                          |#########
#########| ENDPRO                                                   |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| *    Use keys.hdr to make an expression more             |#########
#########| *    readable/supportable.                               |#########
#########|                                                          |#########
#########| z = inkey()                                              |#########
#########| IF z = &F_10                                             |#########
#########|     DO second_menu                                       |#########
#########|     {...}                                                |#########
#########+----------------------------------------------------------+#########
##############################################################################

See Also: delay() get_key() is_key() lastkey() no_burn_key()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson